<!--10-arguments隐形参数.html-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>arguments隐形参数</title>
    <script type="text/javascript">
        function fun(a) {
            console.log("a = " + a);
            // console.log(arguments);
            for (let i = 0; i < arguments.length; i++) {
                console.log(arguments[i]);
            }
        }

        fun(1,"ylaihui",".com");

        function sum(num1, num2) {
            var result = 0;
            for (let i = 0; i < arguments.length; i++) {
                result += arguments[i];
            }
            return result;
        }

        console.log(sum(1,2,3));
    </script>
</head>
<body>

</body>
</html>